package com.example.app.model.common;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import java.io.Serializable;
import java.util.Date;

/**
 * Created by ygl on 2017/4/18.
 */
@MappedSuperclass
@EqualsAndHashCode(callSuper = false)
@Data
public class CommonModel implements Serializable {

    @Column(name = "created_by",length = 64)
    protected String createdBy;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "creation_time",length = 100 )
    protected Date creationTime;

    @Column(name = "creation_method",length = 100 )
    protected String creationMethod;

    @Column(name = "updated_by",length = 64 )
    protected String updatedBy;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "update_time",length = 100 )
    protected Date updateTime;

    @Column(name = "update_method",length = 100)
    protected String updateMethod;

    @Column(name = "delete_flag",length = 1)
    protected Integer deleteFlag = 0;
}
